﻿// D:\DailyWork\shixi\prim\mini-mine-digital-mine-system\QuantyView3D_SDK\build\3DFrame\QuantyView3d\MiniMine\UI\DIO\REGISTER.cpp: 实现文件
//


#include "REGISTER.h"
#include "afxdialogex.h"


// REGISTER 对话框

IMPLEMENT_DYNAMIC(REGISTER, CDialogEx)

REGISTER::REGISTER(CWnd* pParent /*=nullptr*/)
	: CDialogEx(IDD_REGISTER, pParent)
{

}

REGISTER::~REGISTER()
{
}

void REGISTER::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_NEWNAME, newname);
	DDX_Control(pDX, IDC_NEWPASSWORD, newpassword);
}


BEGIN_MESSAGE_MAP(REGISTER, CDialogEx)
	ON_BN_CLICKED(IDC_REGISTER, &REGISTER::OnBnClickedButton1)
	ON_BN_CLICKED(IDC_BACKLOGIN, &REGISTER::OnBnClickedRegisterBacklogin)
END_MESSAGE_MAP()


// REGISTER 消息处理程序


void REGISTER::OnBnClickedButton1()
{
	// TODO: 在此添加控件通知处理程序代码
	//登陆按钮点击事件
	UpdateData(TRUE);

	CString strName, strPassword;
	newname.GetWindowText(strName);
	newpassword.GetWindowText(strPassword);

	if (strName.IsEmpty() || strPassword.IsEmpty())
	{
		MessageBox(NULL, TEXT("用户名和密码不能为空！"));
		return;
	}
	User_ST user;
	user.name = strName;
	user.password = strPassword;
	DIO::UserRegister(user);
	//REGISTER::OnCancel();
	return;
}


void REGISTER::OnBnClickedRegisterBacklogin()
{
	// TODO: 在此添加控件通知处理程序代码
	LOGIN dlg;
	dlg.DoModal();
}
